<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="<%=request.getContextPath() %>/Hplus/favicon.ico"> 
    <link href="<%=request.getContextPath() %>/Hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/Hplus/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- jqgrid-->
    <link href="<%=request.getContextPath() %>/Hplus/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">

    <link href="<%=request.getContextPath() %>/Hplus/css/animate.css" rel="stylesheet">
    <link href="<%=request.getContextPath() %>/Hplus/css/style.css?v=4.1.0" rel="stylesheet">

    <style>
        /* Additional style to fix warning dialog position */

        #alertmod_table_list_2 {
            top: 900px !important;
        }
        
        .close{
        	position:relative;
        	background-color: red;
        	margin-top:-5px;
        	margin-right:-10px;
        	
        }
        
        .tabSpan{
        	background-color: #F4A460;
        	font-size:25px;
        	cursor:pointer;
        }
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
    <input type="hidden" id="sql" value="select t.user_name as userName, t.age, t.roleCode from t_sys_user t"/>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        
                    </div>
                    <div class="ibox-content">
                        <form method="get" class="form-horizontal">
                        	<input type="hidden" id="oldsearchNo" value="${requestScope.searchNo }"/>
                        	<div class="form-group">
						        <label class="col-sm-4 control-label">标识：</label>
						        <div class="col-sm-5">
						            <input type="text" id="searchNo"  class="form-control" placeholder="请输入标识" >
						        </div>
						    </div>
                        	
                            <div class="form-group">
						        <label class="col-sm-4 control-label">文本信息：</label>
						        <div class="col-sm-5">
						            <input type="text" id="inputVal" class="form-control" placeholder="请输入文本" >
						        </div>
						    </div>
						    
					    
                           
                           	<div class="form-group">
						        <label class="col-sm-4 control-label">选择字段：</label>
						        <div class="col-sm-5">
						            <select id="filedSel" class="form-control">
						            	
						            </select>
						        </div>
						    </div>
                           
						    
						    <div class="form-group">
						        <label class="col-sm-4 control-label"></label>
						        <div class="col-sm-5">
						            <button type="button" class="btn btn-primary" onclick="saveSearchInfo();">确定</button>
						        </div>
						    </div>
                        </form>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>

    

    <!-- 全局js -->
    <script src="<%=request.getContextPath() %>/Hplus/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath() %>/Hplus/js/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="<%=request.getContextPath() %>/Hplus/js/content.js?v=1.0.0"></script>

    <!-- iCheck -->
    <script src="<%=request.getContextPath() %>/Hplus/js/plugins/iCheck/icheck.min.js"></script>
    
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/baseUI.js"></script>
    <script>
       
    $(document).ready(function(){
		getSelectInfo();
	});

  	function getSelectInfo(){
  		var sql = $("#sql").val();
  		var url = "<%=request.getContextPath() %>/curdList/getColInfo";
  		$.ajax({
  			url:url,
  			type:"POST",
  			dataType:"json",
  			async:false,
  			data:{sql:sql},
  			success:function(data){
  				setSelectInfo(data);
  			}
  		});
  	}
  	
  	function setSelectInfo(data){
  		$("#filedSel").html("");
  		var html = "<option value=''>请选择</option>";
  		for(var i = 0; i < data.length; i++){
  			html += "<option value='"+data[i]+"'>"+data[i]+"</option>";
  		}
  		$("#filedSel").append(html);
  	}
  	
  	
  	function saveSearchInfo(){
  		var searchNo = $("#searchNo").val();
  		var inputVal = $("#inputVal").val();
  		var filedSel = $("#filedSel").val();
  		
  		var params = searchNo + "," + inputVal+ "," + filedSel;
  		
  		var len = $("#searchTab",window.parent.document).find("tr").find("td").length;
  		
  		var html = "<td>";
    	html += "<div class=\"form-group\">";
  		html += "<label class=\"col-sm-1 control-label\">"+inputVal+"</label>";
  		html += "<div class=\"col-sm-1\">";
  		html += "<input type='text'  value='"+filedSel+"' class=\"form-control\"/>"
  		html += "<input type='hidden' id='search"+searchNo+"' name='search'"+len+" value='"+params+"'/>";
  		html += "</div>";
  		html += "</div>";
  		html += "</td>";
  		
  		$(".tabSearchTr",window.parent.document).append(html);
  		
  		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        parent.layer.close(index);
  		
  	}
    </script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->

</body>
</html>